package com.yehebl.handler.manager;

import java.util.HashMap;
import java.util.Map;

/**
 * 参数map
 *
 * @author tzd
 */
public class MethodParamNamesManager {
    private Map<String, String[]> map = new HashMap<String, String[]>();

    /**
     * 添加参数map
     *
     * @param key
     * @param clazzs
     */
    public void add(String key, String[] paramNames) {
        if (map.containsKey(key)) {
            throw new RuntimeException("处理器[" + key + "]重复");
        }
        map.put(key, paramNames);
    }

    public String[] get(String key) {
        if (!map.containsKey(key)) {
            throw new RuntimeException("找不到处理器[" + key + "]");
        }
        return map.get(key);
    }
}
